package com.xzzz.irda.guardcat.server.repos.mysql;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnProperty(value = "xzzz.guardcat.server.repository.type", havingValue = "mysql", matchIfMissing = true)
public class RepoMySQLConfiguration {

    @Bean(name = "logControllerInMySQL")
    public LogControllerInMySQL logControllerInMySQL() {
        return new LogControllerInMySQL();
    }

    @Bean(name = "gcRepository")
    public GcRepositoryInMySQL gcRepositoryInMySQL() {
        return new GcRepositoryInMySQL();
    }

    @Bean(name = "jmmRepository")
    public JmmRepositoryInMySQL jmmRepositoryInMySQL() {
        return new JmmRepositoryInMySQL();
    }

    @Bean(name = "threadRepository")
    public ThreadRepositoryInMySQL threadRepositoryInMySQL() {
        return new ThreadRepositoryInMySQL();
    }
}
